﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Easy.Core.Exceptions
{
    public class KnowException : IKnowException
    {
        public string Message { get; private set; }

        public int ErrorCode { get; private set; }

        public object[] ErrorData { get; private set; }

        public readonly static IKnowException Unknow = new KnowException() { Message = "Unknow Exception", ErrorCode = 99999 };

        public static IKnowException FromKnowException(IKnowException exception)
        {
            return new KnowException() { ErrorCode = exception.ErrorCode, ErrorData = exception.ErrorData, Message = exception.Message };
        }
    }
}
